<template>
	<view class="wrap">
		<u-navbar :is-back="false" title="" :border-bottom="false" :background="{ background: '#5C38E0' }">
			<view class="menu_box">
				<view style="padding-right: 80rpx;">
					<u-icon name="close"></u-icon>
				</view>
				<view style="flex: 2;">
					<u-tabs :list="list" :is-scroll="false" :current="current" @change="tabsChange" bg-color="#5C38E0"
						inactive-color="#999" active-color="#FFF" :bar-style="{background: '#dd524d' }" bar-height="4">
					</u-tabs>
				</view>
				<view style="padding-left: 80rpx;">
					<u-icon name="checkmark" size="36"></u-icon>
				</view>
			</view>
		</u-navbar>
		
		<view class="bill_block">
			<view class="bill_bg"></view>
			<view class="bill_title">
				<view class="bill_title__box">
					<u-image width="80rpx" height="80rpx" src="https://s1.wacdn.com/wis/535/cc10c3ff14aab800_80x80.png">
					</u-image>
					<text>晚餐</text>
				</view>
				<view class="bill_title__number">
					<b-number-input value="10.00" :showUnit="false"></b-number-input>
				</view>
			</view>
		</view>
		
			
		<view class="bill_cate_box">
			<view class="bill_cate_box__item">
				<view>招商银行信用卡</view>
			</view>
			<view class="bill_cate_box__item">
				<view>自己</view>
			</view>
			<view class="bill_cate_box__item">
				<view>2021/04/01 12:23</view>
			</view>
			<view class="bill_cate_box__item">
				<view>单次</view>
			</view>
		</view>

		<view class="form_item">
			<view class="form_item__title">
				备注
			</view>
			<view class="form_item__input">
				<u-input placeholder="" :custom-style="{width: '500upx'}"></u-input>
			</view>
		</view>
		<view class="form_item">
			<view class="form_item__title">
				标签
			</view>
			<view class="form_item__input">
				<u-input placeholder="" :custom-style="{width: '500upx'}"></u-input>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					name: '支出'
				}, {
					name: '收入'
				}, {
					name: '转账'
				}, {
					name: '借贷'
				}],
				current: 0, // tabs组件的current值，表示当前活动的tab选项
				swiperCurrent: 0, // swiper组件的current值，表示当前那个swiper-item是活动的
			}
		},
		methods: {
			// tabs通知swiper切换
			tabsChange(index) {
				this.current = index;
				this.swiperCurrent = index;
			},

			swiperChange(event) {
				this.current = event.detail.current;
				this.swiperCurrent = event.detail.current;
			}
		}
	}
</script>

<style lang="scss">
	.menu_box {
		width: 100%;
		font-size: 32upx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding: 0 30rpx;
		color: #fff;
	}

	.wrap {
		display: flex;
		flex-direction: column;
		height: calc(100vh - var(--window-top));
		width: 100%;
		background-color: #FFFFFF;
	}
	
	.bill_block{
		position: relative;
		height: 200upx;
		
		.bill_bg {
			background-color: #5C38E0;
			position: absolute;
			padding: 50upx;
			width: 100%;
		}
		
		.bill_title {
			position: absolute;
			// top: 40px;
			left: 0px;
			right: 0px;
			
			display: flex;
			flex-direction: row;
			justify-content: space-between;
		
			margin: 20upx 30upx;
			padding: 40upx 20upx;
			border-radius: 10px;
			background-color: #FFFFFF;
			box-shadow: 0px 10px 20px #ccc;
		
			.bill_title__box {
				display: flex;
				flex-direction: row;
				align-items: center;
		
		
				text {
					font-size: 34rpx;
					margin-left: 20rpx;
				}
			}
			
			.bill_title__number{
				margin-right: 20upx;
			}
		
		}
	}
	
	.bill_cate_box {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		padding: 20rpx;

		.bill_cate_box__item {
			width: 50%;
			text-align: center;

			view {
				margin: 10upx;
				padding: 30upx 0;
				display: block;
				border-radius: 5px;
				// font-size: 36upx;
				font-weight: 300;
				color: $uni-text-color;
				border: 1px $uni-text-color-disable solid;
			}
		}
	}

	.form_item {
		display: flex;
		flex-direction: row;
		align-items: center;
		margin: 0 30upx;
		padding: 20upx 0;
		border-bottom: $uni-bg-color-grey solid 1px;

		.form_item__title {
			color: $uni-text-color-grey;
			margin-right: 30upx;
		}

		.form_item__input {

			input {
				width: 300px;
			}
		}
	}
</style>
